local Lua__rzcp = fk.CreateSkill {

  name = "Lua__rzcp",

  tags = { Skill.Combo },

}

Fk:loadTranslationTable{  
    ["Lua__rzcp"] = "日字冲拳",
    ["$Lua__rzcp1"] = "日字冲拳-招式1",
    ["$Lua__rzcp2"] = "日字冲拳-招式2",
    ["$Lua__rzcp3"] = "日字冲拳-气贯长虹",
    ["Lua__rzcpSlash"] = "日字冲拳",
    ["#Lua__rzcpSlash-use"] = "日字冲拳：你可将一张牌当【杀】使用",
    [":Lua__rzcp"] = "连招技（虚拟杀+虚拟杀），你可以将一张牌当【杀】使用。",
}

Lua__rzcp:addEffect(fk.CardUsing, {
  anim_type = "offensive",
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(Lua__rzcp.name) and data.card.trueName == "slash" and not player:isNude() and not data.card:getEffectiveId() and
      data.extra_data and data.extra_data.combo_skill and data.extra_data.combo_skill[Lua__rzcp.name]  --先随便弄个记录，之后再改
  end,
  on_cost = function (self, event, target, player, data)
    local room = player.room
    local use = room:askToUseVirtualCard(target, {
      name = "slash",
      skill_name = Lua__rzcp.name,
      prompt = "#Lua__rzcpSlash-use",
      cancelable = true,
      card_filter = {
        n = 1,
        pattern = ".",
      },
      skip = true,
    })
    if use then
        event:setCostData(self, {extra_data = use})
        return true
    end
  end,
  on_use = function (self, event, target, player, data)
     local room = player.room
     player.room:useCard(event:getCostData(self).extra_data)
  end,
})



Lua__rzcp:addEffect(fk.AfterCardUseDeclared, {
  can_refresh = function (self, event, target, player, data)
    return target == player and player:hasSkill(self, true)
  end,
  on_refresh = function (self, event, target, player, data)
    local room = player.room
    if data.card.trueName == "slash"  then
      if player:getMark(Lua__rzcp.name) > 0 and data.card.trueName == "slash"  and not data.card:getEffectiveId()  then
        data.extra_data = data.extra_data or {}
        data.extra_data.combo_skill = data.extra_data.combo_skill or {}
        data.extra_data.combo_skill[Lua__rzcp.name] = true
      else
        room:setPlayerMark(player, Lua__rzcp.name, 1)
      end
    else
      room:setPlayerMark(player, Lua__rzcp.name, 0)
    end
  end,
})

return Lua__rzcp